#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

const int N = 110;
string s, t;
int main()
{
    cin >> s>>t;
    string bk = s;
    
    for(int i = 0, sz = s.size(); i < sz; i ++)
    {
        
        s = bk;
        reverse(s.begin(),s.end());
        reverse(s.begin(), s.begin() + sz - i);
        reverse(s.begin()+ sz - i, s.end());
        if(s == t){
            puts("Yes");
            return 0;
        }
    }
    puts("No");
    return 0 ;

}